package com.smbms.controller;

import com.smbms.bean.User;
import com.smbms.service.UserService;
import com.smbms.service.impl.UserServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserServiceImpl userService;

    @GetMapping("/login")
    public String login(User user) {
        if (userService.login(user) == null) {
            return "failed";
        }
        return "success";
    }
}
